/*     */ package com.cr.web.controller.system;
/*     */ 
/*     */ import com.cr.common.annotation.Log;
/*     */ import com.cr.common.core.controller.BaseController;
/*     */ import com.cr.common.core.domain.AjaxResult;
/*     */ import com.cr.common.core.page.TableDataInfo;
/*     */ import com.cr.common.enums.BusinessType;
/*     */ import com.cr.system.domain.SysNotice;
/*     */ import com.cr.system.service.ISysNoticeService;
/*     */ import java.util.List;
/*     */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.ui.ModelMap;
/*     */ import org.springframework.web.bind.annotation.GetMapping;
/*     */ import org.springframework.web.bind.annotation.PathVariable;
/*     */ import org.springframework.web.bind.annotation.PostMapping;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ import org.springframework.web.bind.annotation.ResponseBody;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/system/notice"})
/*     */ public class SysNoticeController extends BaseController {
/*  30 */   private String prefix = "system/notice";
/*     */   
/*     */   @Autowired
/*     */   private ISysNoticeService noticeService;
/*     */   
/*     */   @RequiresPermissions({"system:notice:view"})
/*     */   @GetMapping
/*     */   public String notice() {
/*  39 */     return this.prefix + "/notice";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"system:notice:list"})
/*     */   @PostMapping({"/list"})
/*     */   @ResponseBody
/*     */   public TableDataInfo list(SysNotice notice) {
/*  50 */     startPage();
/*  51 */     List<SysNotice> list = this.noticeService.selectNoticeList(notice);
/*  52 */     return getDataTable(list);
/*     */   }
/*     */   
/*     */   @GetMapping({"/add"})
/*     */   public String add() {
/*  61 */     return this.prefix + "/add";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"system:notice:add"})
/*     */   @Log(title = "通知公告", businessType = BusinessType.INSERT)
/*     */   @PostMapping({"/add"})
/*     */   @ResponseBody
/*     */   public AjaxResult addSave(SysNotice notice) {
/*  73 */     notice.setCreateBy(getLoginName());
/*  74 */     return toAjax(this.noticeService.insertNotice(notice));
/*     */   }
/*     */   
/*     */   @GetMapping({"/edit/{noticeId}"})
/*     */   public String edit(@PathVariable("noticeId") Long noticeId, ModelMap mmap) {
/*  83 */     mmap.put("notice", this.noticeService.selectNoticeById(noticeId));
/*  84 */     return this.prefix + "/edit";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"system:notice:edit"})
/*     */   @Log(title = "通知公告", businessType = BusinessType.UPDATE)
/*     */   @PostMapping({"/edit"})
/*     */   @ResponseBody
/*     */   public AjaxResult editSave(SysNotice notice) {
/*  96 */     notice.setUpdateBy(getLoginName());
/*  97 */     return toAjax(this.noticeService.updateNotice(notice));
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"system:notice:remove"})
/*     */   @Log(title = "通知公告", businessType = BusinessType.DELETE)
/*     */   @PostMapping({"/remove"})
/*     */   @ResponseBody
/*     */   public AjaxResult remove(String ids) {
/* 109 */     return toAjax(this.noticeService.deleteNoticeByIds(ids));
/*     */   }
/*     */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\classes\com.zip!\com\cr\web\controller\system\SysNoticeController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */